package com.qf.vote2203.ex;

import cn.hutool.extra.mail.MailUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobleHandler {

    @ExceptionHandler(Exception.class)
    public String handlerException(Exception e){

        MailUtil.send("1079012199@qq.com", "出现了异常", e.getMessage(), false);

        return "出现了系统异常，已将错误信息反馈给运维人员，请稍后重试";
    }
}
